// GetColor.cpp: implementation of the CGetColor class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Vincent.h"
#include "GetColor.h"

#include "MainFrm.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CGetColor::CGetColor()
{

}

CGetColor::~CGetColor()
{

}

void CGetColor::Draw(CDC *pDC)
{

}

void CGetColor::OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point, CPoint scrolled)
{
	// pDC에서 얻어온 픽셀의 RGB를 전경색에 넣어준다.
	((CVincentDoc*)((CMainFrame*)AfxGetMainWnd())->GetActiveDocument())->SetForegroundColor(pDC->GetPixel(point));
}

void CGetColor::OnRButtonDown(CDC *pDC, UINT nFlags, CPoint point, CPoint scrolled)
{
	// pDC에서 얻어온 픽셀의 RGB를 배경색에 넣어준다.
	((CVincentDoc*)((CMainFrame*)AfxGetMainWnd())->GetActiveDocument())->SetBackgroundColor(pDC->GetPixel(point));
}
